home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / IconCellRenderer.as < prev    next >
Text File  |  2007-11-08  |  1KB  |  56 lines

  1. class IconCellRenderer extends mx.core.UIComponent
  2. {
  3.    function IconCellRenderer()
  4.    {
  5.       super();
  6.    }
  7.    function createChildren(Void)
  8.    {
  9.       this.firstSizeCompleted = false;
  10.    }
  11.    function size(Void)
  12.    {
  13.       this.invalidate();
  14.    }
  15.    function draw(Void)
  16.    {
  17.       if(this.icon_mc != undefined)
  18.       {
  19.          this.icon_mc._x = (this.__width - this.icon_mc._width) / 2;
  20.       }
  21.    }
  22.    function setValue(str, item, sel)
  23.    {
  24.       if(item == undefined)
  25.       {
  26.          if(this.icon_mc != undefined)
  27.          {
  28.             this.icon_mc.removeMovieClip();
  29.             delete this.icon_mc;
  30.          }
  31.          return undefined;
  32.       }
  33.       if(this.icon_mc != undefined)
  34.       {
  35.          this.icon_mc.removeMovieClip();
  36.       }
  37.       var _loc2_ = this.columnIndex;
  38.       var _loc5_ = this.listOwner.getColumnAt(_loc2_).columnName;
  39.       var _loc3_ = this.listOwner.getColumnAt(_loc2_).iconFunction;
  40.       if(_loc3_ != undefined)
  41.       {
  42.          var _loc4_ = _loc3_(item,_loc5_);
  43.          if(_loc4_ != undefined)
  44.          {
  45.             this.icon_mc = this.createObject(_loc4_,"icon_mc",20);
  46.             this.icon_mc._x = (this.__width - this.icon_mc._width) / 2;
  47.             this.icon_mc._y = (this.__height - this.icon_mc._height) / 2;
  48.          }
  49.       }
  50.    }
  51.    function getPreferredHeight(Void)
  52.    {
  53.       return this.owner.__height;
  54.    }
  55. }
  56.